<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>柱状图</title>
    <script
      type="text/javascript"
      src="../static/plugins/echarts.min.js"
    ></script>
  </head>
  <body>
    <div style="width: 800px; height: 440px" id="main"></div>
  </body>
  <script type="text/javascript">
    var myChart = echarts.init(document.getElementById('main'));
    var option = {
      xAxis: {
        type: 'category',
        data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
      },
      yAxis: {
        type: 'value',
      },
      series: [
        {
          data: [420, 200, 350, 500, 670, 810, 1130],
          type: 'bar',
          barWidth: 20,
        },
      ],
    };
    // myChart.setOption(option);
    option && myChart.setOption(option);
  </script>
</html>
